TEXFILES=protjex.tex definitions.tex cover.tex partners-codes.tex objectives.tex progress-beyond-state-art.tex workplan.tex workpackage-1.tex summary-effort.tex management.tex participants.tex partners-codes.tex organization-1.tex consortium.tex resources.tex summary-effort.tex impact.tex dissemination.tex ethical-issues.tex gender.tex partners-data.info summary.tex

default: protjex.pdf

MAIN = protjex.tex
RERUN = "Label(s) may have changed. Rerun to get cross-references right."

-include .texfiles

protjex.pdf: $(TEXFILES)
	ruby generate-definitions.rb partners-data.info > definitions.tex
	pdflatex $(MAIN)
	- (grep -q $(RERUN) $(MAIN:.tex=.log) && pdflatex $(MAIN))

projex.ps: protjex.pdf
	pdftops protjex.pdf

bib:
	bibtex protjex

depend:
	echo -n "TEXFILES = " > .texfiles
	echo *.tex >> .texfiles

clean:
	-rm protjex.{dvi,ps,pdf,log,aux,toc}

.phony: depend clean

